var mysql = require("mysql2")

var pool = mysql.createPool({
    port: 3306,
    host: "localhost",
    database: "businesscard_test",
    user: "root",
    password: "123456",
})

function getConnect(){
    return new Promise((resolve,reject)=>{
        pool.getConnection((err,connect)=>{
            if(err){
                reject(err)
            }else{
                resolve(connect)
            }
        })
    })
}

module.exports = {getConnect}

